package proxy

import (
	"fmt"
	"github.com/kataras/iris/v12"
	"gluenet/pkg/apis"
)

func ProxyPrometheusQuery(c *apis.StorageContext) {
	//c.Logger.Debugf("proxy")
	url := c.WebContext.Params().Get("url")
	//c.WebContext.Params()
	//c.WebContext.Params().
	c.Logger.Debugf("proxy url %v to prom", url)
	c.WebContext.Redirect(fmt.Sprintf("http://localhost:9090/api/%v", url), iris.StatusPermanentRedirect)
}
